home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / pascal / fastwr50.zip / FASTWR.PAS < prev    next >
Pascal/Delphi Source File  |  1987-11-08  |  3KB  |  84 lines

  1. {$S-,R-,V-,D-,T-}
  2.  
  3. unit FastWr;
  4.   {-Fast screen writing routines}
  5.  
  6. interface
  7.  
  8. type
  9.   DisplayType = (Monochrome, CGA, EGA, MCGA, VGA);
  10. var
  11.   BaseOfScreen : Word;       {Base address of video memory}
  12.   WaitForRetrace : Boolean;  {Check for snow on color cards?}
  13.  
  14. procedure FastWrite(St : string; Row, Col, Attr : Byte);
  15.   {-Writes St at Row,Col in Attr (video attribute) without snow}
  16.  
  17. procedure FastWriteNA(St : string; Row, Col : Byte);
  18.   {-Writes St at Row,Col without snow, but doesn't change video attributes}
  19.  
  20. procedure ChangeAttribute(Number : Word; Row, Col, Attr : Byte);
  21.   {-Changes Number video attributes to Attr starting at Row,Col}
  22.  
  23. procedure MoveFromScreen(var Source, Dest; Length : Word);
  24.   {-Moves Length words from Source (video memory) to Dest without snow}
  25.  
  26. procedure MoveToScreen(var Source, Dest; Length : Word);
  27.   {-Moves Length words from Source to Dest (video memory) without snow}
  28.  
  29. function CurrentDisplay : DisplayType;
  30.   {-Returns type of the currently active display}
  31.  
  32. procedure ReinitFastWrite;
  33.   {-Initializes WaitForRetrace and BaseOfScreen. Called automatically before
  34.     program starts.}
  35.  
  36. implementation
  37.  
  38.   {$L FASTWR}
  39.  
  40.   {$F+}
  41.   procedure FastWrite(St : string; Row, Col, Attr : Byte);
  42.     {-Writes St at Row,Col in Attr (video attribute) without snow}
  43.     external {FASTWR} ;
  44.  
  45.   procedure FastWriteNA(St : string; Row, Col : Byte);
  46.     {-Writes St at Row,Col without snow, but doesn't change video attributes}
  47.     external {FASTWR} ;
  48.  
  49.   procedure ChangeAttribute(Number : Word; Row, Col, Attr : Byte);
  50.     {-Changes Number video attributes to Attr starting at Row,Col}
  51.     external {FASTWR} ;
  52.  
  53.   procedure MoveFromScreen(var Source, Dest; Length : Word);
  54.     {-Moves Length words from Source (video memory) to Dest without snow}
  55.     external {FASTWR} ;
  56.  
  57.   procedure MoveToScreen(var Source, Dest; Length : Word);
  58.     {-Moves Length words from Source to Dest (video memory) without snow}
  59.     external {FASTWR} ;
  60.  
  61.   function CurrentDisplay : DisplayType;
  62.     {-Returns type of the currently active display}
  63.     external {FASTWR} ;
  64.  
  65.   function CurrentVideoMode : Byte;
  66.     {-Returns current video mode}
  67.     external {FASTWR} ;
  68.   {$F-}
  69.  
  70.   procedure ReinitFastWrite;
  71.     {-Initializes WaitForRetrace and BaseOfScreen}
  72.   begin                      {InitFastWrite}
  73.     {initialize WaitForRetrace and BaseOfScreen}
  74.     if CurrentVideoMode = 7 then
  75.       BaseOfScreen := $B000  {Mono}
  76.     else
  77.       BaseOfScreen := $B800; {Color}
  78.     WaitForRetrace := (CurrentDisplay = CGA);
  79.   end;                       {InitFastWrite}
  80.  
  81. begin
  82.   ReinitFastWrite;
  83. end.
  84.